Commit 72833c7fba for ffmpeg
commit 72833c7fba27a9665392a908dc96526feb613538
Author: Rainbaby <r@bgr.jp>
Date: Sat Sep 5 16:00:55 2026 +0900
avcodec/cavsdec: check decode_pic() return value
A picture that failed to decode, whether from an invalid header, a
missing reference, a refused feature or truncated data, was reported
as consumed with no frame and no error. The error now reaches the
caller.
Signed-off-by: Rainbaby <r@bgr.jp>
diff --git a/libavcodec/cavsdec.c b/libavcodec/cavsdec.c
index 58613b2f4c..953d2fc503 100644
--- a/libavcodec/cavsdec.c
+++ b/libavcodec/cavsdec.c
@@ -1292,8 +1292,9 @@ static int cavs_decode_frame(AVCodecContext *avctx, AVFrame *rframe,
if (!h->got_keyframe)
break;
h->stc = stc;
- if (decode_pic(h))
- break;
+ ret = decode_pic(h);
+ if (ret < 0)
+ return ret;
*got_frame = 1;
if (h->cur.f->pict_type != AV_PICTURE_TYPE_B) {
if (h->DPB[!h->low_delay].f->data[0]) {