]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/ralf.c
avfilter/vf_psnr: remove unnecessary check
[ffmpeg] / libavcodec / ralf.c
index 08e8043e30b683efbd1090e808a646362906461f..2b253c5711dbd6776a83ed657747728e71943b3a 100644 (file)
@@ -482,6 +482,8 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr,
     init_get_bits(&gb, src + 2, table_size);
     ctx->num_blocks = 0;
     while (get_bits_left(&gb) > 0) {
+        if (ctx->num_blocks >= FF_ARRAY_ELEMS(ctx->block_size))
+            return AVERROR_INVALIDDATA;
         ctx->block_size[ctx->num_blocks] = get_bits(&gb, 13 + avctx->channels);
         if (get_bits1(&gb)) {
             ctx->block_pts[ctx->num_blocks] = get_bits(&gb, 9);
@@ -523,7 +525,7 @@ static void decode_flush(AVCodecContext *avctx)
 }
 
 
-AVCodec ff_ralf_decoder = {
+const AVCodec ff_ralf_decoder = {
     .name           = "ralf",
     .long_name      = NULL_IF_CONFIG_SMALL("RealAudio Lossless"),
     .type           = AVMEDIA_TYPE_AUDIO,
@@ -533,7 +535,8 @@ AVCodec ff_ralf_decoder = {
     .close          = decode_close,
     .decode         = decode_frame,
     .flush          = decode_flush,
-    .capabilities   = AV_CODEC_CAP_DR1,
+    .capabilities   = AV_CODEC_CAP_CHANNEL_CONF |
+                      AV_CODEC_CAP_DR1,
     .sample_fmts    = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P,
                                                       AV_SAMPLE_FMT_NONE },
 };