]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/vp9_parser.c
avcodec/dxtory: Fix input size check in dxtory_decode_v1_420()
[ffmpeg] / libavcodec / vp9_parser.c
index 0437097391d5bfbff80823289fe3ab1463d42b62..2e9235e6570ff690a4401285044d106526be6285 100644 (file)
@@ -64,7 +64,7 @@ static int parse_frame(AVCodecParserContext *ctx, const uint8_t *buf, int size)
         if (ctx->pts == AV_NOPTS_VALUE)
             ctx->pts = s->pts;
         s->pts = AV_NOPTS_VALUE;
-    } else {
+    } else if (ctx->pts != AV_NOPTS_VALUE) {
         s->pts = ctx->pts;
         ctx->pts = AV_NOPTS_VALUE;
     }
@@ -132,7 +132,7 @@ static int parse(AVCodecParserContext *ctx,
                     size -= sz; \
                 } \
                 parse_frame(ctx, *out_data, *out_size); \
-                return *out_size
+                return s->n_frames > 0 ? *out_size : full_size
 
                 case_n(1, *idx);
                 case_n(2, AV_RL16(idx));