diff options
author | Diego Biurrun <diego@biurrun.de> | 2016-06-20 18:44:20 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2016-07-25 13:57:02 +0200 |
commit | da76299272e4cfda6aaa4b136f92f7829c82fa1a (patch) | |
tree | b8fe7abb50eafcda5f76c4985d03b2c032484aac | |
parent | 5312d7a47f638a9c6eb0dbddaf74080b17786e38 (diff) |
cfhd: Move up check for got_buffer to directly after is is set
-rw-r--r-- | libavcodec/cfhd.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libavcodec/cfhd.c b/libavcodec/cfhd.c index 20dacd1705..7de1d5488f 100644 --- a/libavcodec/cfhd.c +++ b/libavcodec/cfhd.c @@ -723,6 +723,11 @@ static int cfhd_decode(AVCodecContext *avctx, void *data, int *got_frame, got_buffer = 1; } + if (!got_buffer) { + av_log(avctx, AV_LOG_ERROR, "No end of header tag found\n"); + return AVERROR_INVALIDDATA; + } + while (bytestream2_get_bytes_left(&gb) > 4) { if ((ret = parse_tag(avctx, s, &gb, &tag, &value, &planes)) < 0) break; @@ -745,11 +750,6 @@ static int cfhd_decode(AVCodecContext *avctx, void *data, int *got_frame, return AVERROR_INVALIDDATA; } - if (!got_buffer) { - av_log(avctx, AV_LOG_ERROR, "No end of header tag found\n"); - return AVERROR_INVALIDDATA; - } - planes = av_pix_fmt_count_planes(avctx->pix_fmt); for (plane = 0; plane < planes; plane++) { /* level 1 */ |