# HG changeset patch # User reimar # Date 1253210887 0 # Node ID 7c0b8cd87f5a35e67f7618aa36ecd3347619c918 # Parent 6fc9f9d8aaa1b1f07fe3f32482e53138c4bd91ec Improve dxa probe by checking the values for width and height are reasonable. diff -r 6fc9f9d8aaa1 -r 7c0b8cd87f5a dxa.c --- a/dxa.c Thu Sep 17 18:07:27 2009 +0000 +++ b/dxa.c Thu Sep 17 18:08:07 2009 +0000 @@ -36,9 +36,15 @@ static int dxa_probe(AVProbeData *p) { + int w, h; + if (p->buf_size < 15) + return 0; + w = AV_RB16(p->buf + 11); + h = AV_RB16(p->buf + 13); /* check file header */ if (p->buf[0] == 'D' && p->buf[1] == 'E' && - p->buf[2] == 'X' && p->buf[3] == 'A') + p->buf[2] == 'X' && p->buf[3] == 'A' && + w && w <= 2048 && h && h <= 2048) return AVPROBE_SCORE_MAX; else return 0;