'context_count' is used as a positive
array index so declare it as unsigned,
and exit early if it is zero.
---
libavcodec/h264.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index a9a1051..bc68c75 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -3697,13 +3697,13 @@ static int decode_slice(struct AVCodecContext *avctx,
void *arg){
* @param h h264 master context
* @param context_count number of contexts to execute
*/
-static int execute_decode_slices(H264Context *h, int context_count){
+static int execute_decode_slices(H264Context *h, unsigned int context_count){
MpegEncContext * const s = &h->s;
AVCodecContext * const avctx= s->avctx;
H264Context *hx;
int i;
- if (s->avctx->hwaccel ||
s->avctx->codec->capabilities&CODEC_CAP_HWACCEL_VDPAU)
+ if (context_count == 0 || s->avctx->hwaccel ||
s->avctx->codec->capabilities&CODEC_CAP_HWACCEL_VDPAU)
return 0;
if(context_count == 1) {
return decode_slice(avctx, &h);
--
1.7.8
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel