diff --git a/libavcodec/apedec.c b/libavcodec/apedec.c index d28e51aae6..26056239fd 100644 --- a/libavcodec/apedec.c +++ b/libavcodec/apedec.c @@ -1402,7 +1402,6 @@ static int ape_decode_frame(AVCodecContext *avctx, void *data, int32_t *sample24; int i, ch, ret; int blockstodecode; - int bytes_used = 0; /* this should never be negative, but bad things will happen if it is, so check it just to make sure. */ @@ -1468,7 +1467,6 @@ static int ape_decode_frame(AVCodecContext *avctx, void *data, return AVERROR_INVALIDDATA; } - bytes_used = avpkt->size; } if (!s->data) { @@ -1540,7 +1538,7 @@ static int ape_decode_frame(AVCodecContext *avctx, void *data, *got_frame_ptr = 1; - return bytes_used; + return (s->samples == 0) ? avpkt->size : 0; } static void ape_flush(AVCodecContext *avctx)