]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/on2avc.c
hevc: store the escaped/raw bitstream in HEVCNAL
[ffmpeg] / libavcodec / on2avc.c
index e4415fce82cb3d90f86838c2ef7b9e2ea5c7ff38..c00339f7b0fdace26ee88a0710b3582ac43b1d15 100644 (file)
@@ -24,7 +24,6 @@
 #include "libavutil/float_dsp.h"
 #include "avcodec.h"
 #include "bytestream.h"
-#include "dsputil.h"
 #include "fft.h"
 #include "get_bits.h"
 #include "golomb.h"
@@ -173,7 +172,7 @@ static int on2avc_decode_band_scales(On2AVCContext *c, GetBitContext *gb)
             } else {
                 scale += get_vlc2(gb, c->scale_diff.table, 9, 3) - 60;
             }
-            if (scale < 0 || scale > 128) {
+            if (scale < 0 || scale > 127) {
                 av_log(c->avctx, AV_LOG_ERROR, "Invalid scale value %d\n",
                        scale);
                 return AVERROR_INVALIDDATA;
@@ -919,6 +918,10 @@ static av_cold int on2avc_decode_init(AVCodecContext *avctx)
         av_log(avctx, AV_LOG_ERROR, "0x500 version should be mono\n");
         return AVERROR_INVALIDDATA;
     }
+    if (avctx->channels > 2) {
+        av_log(avctx, AV_LOG_ERROR, "Only 1 or 2 channels are supported.\n");
+        return AVERROR(EINVAL);
+    }
     if (avctx->channels == 2)
         av_log(avctx, AV_LOG_WARNING,
                "Stereo mode support is not good, patch is welcome\n");