summaryrefslogtreecommitdiff
path: root/libavformat/dxa.c
diff options
context:
space:
mode:
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>2009-09-17 18:08:07 +0000
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>2009-09-17 18:08:07 +0000
commit3214db98ea1c71f6e6bb67adf077c695ac572692 (patch)
tree8f261f2df16886082ba5da8ef8028d99984367ad /libavformat/dxa.c
parent892d7e78ef12404db31adf440c30df73bb4890e5 (diff)
Improve dxa probe by checking the values for width and height are reasonable.
Originally committed as revision 19897 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/dxa.c')
-rw-r--r--libavformat/dxa.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/libavformat/dxa.c b/libavformat/dxa.c
index 5b6cd67b59..a68d4c4efb 100644
--- a/libavformat/dxa.c
+++ b/libavformat/dxa.c
@@ -36,9 +36,15 @@ typedef struct{
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;