summaryrefslogtreecommitdiff
path: root/libavcodec/cuvid.c
diff options
context:
space:
mode:
authorPhilip Langdale <philipl@overt.org>2016-09-10 12:51:01 -0700
committerTimo Rothenpieler <timo@rothenpieler.org>2016-09-10 22:27:24 +0200
commit4029f05c8b0943a5446f254142d5e2bfedb50a0d (patch)
tree69d6648e346800da2995dcd6aa85d9beb155f874 /libavcodec/cuvid.c
parentb257266ee8b3f6db5d6135ba7c8fbcd3fba5c9dc (diff)
avcodec/cuvid: Always check for internal errors during parsing
The cuvid parser is basically undocumented, and although you'd think that a failed callback would result in the overall parse call returning an error, that is not true. So, we end up silently trying to keep going as if nothing is wrong, which doesn't achieve anything. Solution: check the internal error flag every time. Signed-off-by: Philip Langdale <philipl@overt.org> Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
Diffstat (limited to 'libavcodec/cuvid.c')
-rw-r--r--libavcodec/cuvid.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/libavcodec/cuvid.c b/libavcodec/cuvid.c
index de75960ecc..19a7772258 100644
--- a/libavcodec/cuvid.c
+++ b/libavcodec/cuvid.c
@@ -272,8 +272,13 @@ static int cuvid_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
av_packet_unref(&filtered_packet);
if (ret < 0) {
- if (ctx->internal_error)
- ret = ctx->internal_error;
+ goto error;
+ }
+
+ // cuvidParseVideoData doesn't return an error just because stuff failed...
+ if (ctx->internal_error) {
+ av_log(avctx, AV_LOG_ERROR, "cuvid decode callback error\n");
+ ret = ctx->internal_error;
goto error;
}