diff options
author | Peter Ross <pross@xvid.org> | 2020-04-25 11:25:15 +1000 |
---|---|---|
committer | Peter Ross <pross@xvid.org> | 2020-04-25 12:11:11 +1000 |
commit | 1217b06a9b5e8264fa86ab0e7573564c39bf3ce9 (patch) | |
tree | f6705553c48c845ad81e5214d76db3bf0dbc9052 /libavcodec/vp9.c | |
parent | 5a2a1990319f141314b707676eca400e2d317189 (diff) | |
download | ffmpeg-1217b06a9b5e8264fa86ab0e7573564c39bf3ce9.tar.gz |
avcodec/vp9: prevent null pointer use on init_frames() failure
Signed-off-by: Peter Ross <pross@xvid.org>
Reviewed-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/vp9.c')
-rw-r--r-- | libavcodec/vp9.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c index 2a3a4555b9..b356b24515 100644 --- a/libavcodec/vp9.c +++ b/libavcodec/vp9.c @@ -1216,17 +1216,14 @@ static av_cold int vp9_decode_free(AVCodecContext *avctx) int i; for (i = 0; i < 3; i++) { - if (s->s.frames[i].tf.f->buf[0]) - vp9_frame_unref(avctx, &s->s.frames[i]); + vp9_frame_unref(avctx, &s->s.frames[i]); av_frame_free(&s->s.frames[i].tf.f); } av_buffer_pool_uninit(&s->frame_extradata_pool); for (i = 0; i < 8; i++) { - if (s->s.refs[i].f->buf[0]) - ff_thread_release_buffer(avctx, &s->s.refs[i]); + ff_thread_release_buffer(avctx, &s->s.refs[i]); av_frame_free(&s->s.refs[i].f); - if (s->next_refs[i].f->buf[0]) - ff_thread_release_buffer(avctx, &s->next_refs[i]); + ff_thread_release_buffer(avctx, &s->next_refs[i]); av_frame_free(&s->next_refs[i].f); } |