[FFmpeg-cvslog] avcodec/hevc_refs: fix potential use of uninitialized min_idx

Michael Niedermayer git at videolan.org
Wed Dec 10 15:00:05 CET 2014


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Wed Dec 10 14:34:46 2014 +0100| [ae93965359e71c1f88ba170f8efd6a198344c235] | committer: Michael Niedermayer

avcodec/hevc_refs: fix potential use of uninitialized min_idx

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavcodec/hevc_refs.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/hevc_refs.c b/libavcodec/hevc_refs.c
index b3a9787..92196a1 100644
--- a/libavcodec/hevc_refs.c
+++ b/libavcodec/hevc_refs.c
@@ -173,7 +173,7 @@ int ff_hevc_output_frame(HEVCContext *s, AVFrame *out, int flush)
             if ((frame->flags & HEVC_FRAME_FLAG_OUTPUT) &&
                 frame->sequence == s->seq_output) {
                 nb_output++;
-                if (frame->poc < min_poc) {
+                if (frame->poc < min_poc || nb_output == 1) {
                     min_poc = frame->poc;
                     min_idx = i;
                 }



More information about the ffmpeg-cvslog mailing list