mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
png: improve signature check
Return proper error code, print an error message and add missing parentheses.
This commit is contained in:
parent
456ffec35d
commit
1e76345432
@ -415,9 +415,10 @@ static int decode_frame(AVCodecContext *avctx,
|
||||
|
||||
/* check signature */
|
||||
if (buf_size < 8 ||
|
||||
memcmp(buf, ff_pngsig, 8) != 0 &&
|
||||
memcmp(buf, ff_mngsig, 8) != 0)
|
||||
return -1;
|
||||
(memcmp(buf, ff_pngsig, 8) != 0 && memcmp(buf, ff_mngsig, 8) != 0)) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Invalid PNG signature (%d).\n", buf_size);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
bytestream2_init(&s->gb, buf + 8, buf_size - 8);
|
||||
s->y = s->state = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user