diff --git a/libavcodec/huffyuv.c b/libavcodec/huffyuv.c index aca2e92c5b..80b35ed9c8 100644 --- a/libavcodec/huffyuv.c +++ b/libavcodec/huffyuv.c @@ -58,7 +58,7 @@ av_cold int ff_huffyuv_alloc_temp(HYuvContext *s) { int i; - if (s->bitstream_bpp<24) { + if (s->bitstream_bpp<24 || s->version > 2) { for (i=0; i<3; i++) { s->temp[i]= av_malloc(2*s->width + 16); if (!s->temp[i]) diff --git a/libavcodec/huffyuvenc.c b/libavcodec/huffyuvenc.c index fd7aa384d6..3cb7293dc1 100644 --- a/libavcodec/huffyuvenc.c +++ b/libavcodec/huffyuvenc.c @@ -349,7 +349,7 @@ static av_cold int encode_init(AVCodecContext *avctx) return AVERROR(EINVAL); } - if (s->bitstream_bpp >= 24 && s->predictor == MEDIAN) { + if (s->bitstream_bpp >= 24 && s->predictor == MEDIAN && s->version <= 2) { av_log(avctx, AV_LOG_ERROR, "Error: RGB is incompatible with median predictor\n"); return AVERROR(EINVAL);