Fixes NULL pointer dereferene in bipbop234.ts_s20131.
---
 libavcodec/h264_refs.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/libavcodec/h264_refs.c b/libavcodec/h264_refs.c
index 755f115..0b88587 100644
--- a/libavcodec/h264_refs.c
+++ b/libavcodec/h264_refs.c
@@ -372,6 +372,12 @@ static Picture * find_short(H264Context *h, int frame_num, 
int *idx){
 
     for(i=0; i<h->short_ref_count; i++){
         Picture *pic= h->short_ref[i];
+        if (!pic) {
+            av_log(h->s.avctx, AV_LOG_WARNING, "invalid short ref count %d "
+                   "without frame at short_ref[%d]\n", h->short_ref_count, i);
+            h->short_ref_count = i;
+            return NULL;
+        }
         if(s->avctx->debug&FF_DEBUG_MMCO)
             av_log(h->s.avctx, AV_LOG_DEBUG, "%d %d %p\n", i, pic->frame_num, 
pic);
         if(pic->frame_num == frame_num) {
-- 
1.7.12.4

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to