Browse code

avcodec/huffyuv: dont depend on bitstream_bpp having a specific value for version>2

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>

Michael Niedermayer authored on 2014/01/28 08:27:57
Showing 2 changed files
... ...
@@ -58,7 +58,7 @@ av_cold int ff_huffyuv_alloc_temp(HYuvContext *s)
58 58
 {
59 59
     int i;
60 60
 
61
-    if (s->bitstream_bpp<24) {
61
+    if (s->bitstream_bpp<24 || s->version > 2) {
62 62
         for (i=0; i<3; i++) {
63 63
             s->temp[i]= av_malloc(2*s->width + 16);
64 64
             if (!s->temp[i])
... ...
@@ -349,7 +349,7 @@ static av_cold int encode_init(AVCodecContext *avctx)
349 349
         return AVERROR(EINVAL);
350 350
     }
351 351
 
352
-    if (s->bitstream_bpp >= 24 && s->predictor == MEDIAN) {
352
+    if (s->bitstream_bpp >= 24 && s->predictor == MEDIAN && s->version <= 2) {
353 353
         av_log(avctx, AV_LOG_ERROR,
354 354
                "Error: RGB is incompatible with median predictor\n");
355 355
         return AVERROR(EINVAL);