mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
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
This commit is contained in:
parent
892d7e78ef
commit
3214db98ea
@ -36,9 +36,15 @@ typedef struct{
|
|||||||
|
|
||||||
static int dxa_probe(AVProbeData *p)
|
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 */
|
/* check file header */
|
||||||
if (p->buf[0] == 'D' && p->buf[1] == 'E' &&
|
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;
|
return AVPROBE_SCORE_MAX;
|
||||||
else
|
else
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user