aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-04-04 19:28:33 +0200
committerMichael Niedermayer <michaelni@gmx.at>2015-04-17 15:20:29 +0200
commit52ba406b94d659dfdb2d8d119a6535474876c205 (patch)
tree8ae5554bc6ba9bf597567e81eec2f96d8209404e
parent071eb56a6a50c49c2341f3d2c69367fc5074f089 (diff)
downloadffmpeg-52ba406b94d659dfdb2d8d119a6535474876c205.tar.gz
avcodec/h264: Fail for invalid mixed IDR / non IDR frames in slice threading mode
Fixes Ticket4408 Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit fc58d5c43b4c7396fc69081eb0dfe5b6a21cb10d) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/h264.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index ac8adf3b11..88fc270ed9 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -1554,8 +1554,14 @@ again:
ret = -1;
goto end;
}
- if(!idr_cleared)
+ if(!idr_cleared) {
+ if (h->current_slice && (avctx->active_thread_type & FF_THREAD_SLICE)) {
+ av_log(h, AV_LOG_ERROR, "invalid mixed IDR / non IDR frames cannot be decoded in slice multithreading mode\n");
+ ret = AVERROR_INVALIDDATA;
+ goto end;
+ }
idr(h); // FIXME ensure we don't lose some frames if there is reordering
+ }
idr_cleared = 1;
h->has_recovery_point = 1;
case NAL_SLICE: