mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-28 20:53:54 +02:00
avcodec/vp9_superframe_split_bsf: Discard invalid zero-sized frames
They are invalid in VP9. If any of the frames inside a superframe had a size of zero, the code would either read into the next frame or into the superframe index; so check for the length to stop this. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
parent
c12e8c97b1
commit
d20ef30f53
@ -70,7 +70,7 @@ static int vp9_superframe_split_filter(AVBSFContext *ctx, AVPacket *out)
|
||||
frame_size |= bytestream2_get_byte(&bc) << (j * 8);
|
||||
|
||||
total_size += frame_size;
|
||||
if (frame_size < 0 || total_size > in->size - idx_size) {
|
||||
if (frame_size <= 0 || total_size > in->size - idx_size) {
|
||||
av_log(ctx, AV_LOG_ERROR,
|
||||
"Invalid frame size in a superframe: %d\n", frame_size);
|
||||
ret = AVERROR(EINVAL);
|
||||
|
Loading…
Reference in New Issue
Block a user