[FFmpeg-cvslog] avcodec/vp9: prevent null pointer use on init_frames() failure

Peter Ross git at videolan.org
Sat Apr 25 05:13:00 EEST 2020


ffmpeg | branch: master | Peter Ross <pross at xvid.org> | Sat Apr 25 11:25:15 2020 +1000| [1217b06a9b5e8264fa86ab0e7573564c39bf3ce9] | committer: Peter Ross

avcodec/vp9: prevent null pointer use on init_frames() failure

Signed-off-by: Peter Ross <pross at xvid.org>
Reviewed-by: James Almer <jamrial at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1217b06a9b5e8264fa86ab0e7573564c39bf3ce9
---

 libavcodec/vp9.c | 9 +++------
 1 file 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);
     }
 



More information about the ffmpeg-cvslog mailing list