avcodec/huffyuv: dont depend on bitstream_bpp having a specific value for version>2
authorMichael Niedermayer <michaelni@gmx.at>
Mon, 27 Jan 2014 23:27:57 +0000 (00:27 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 27 Jan 2014 23:27:57 +0000 (00:27 +0100)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/huffyuv.c
libavcodec/huffyuvenc.c

index aca2e92..80b35ed 100644 (file)
@@ -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])
index fd7aa38..3cb7293 100644 (file)
@@ -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);