avcodec/hevc_refs: fix potential use of uninitialized min_idx
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 10 Dec 2014 13:34:46 +0000 (14:34 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 10 Dec 2014 13:46:39 +0000 (14:46 +0100)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/hevc_refs.c

index b3a9787..92196a1 100644 (file)
@@ -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;
                 }