]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/flac_parser.c
ra288: return error if input buffer is too small
[ffmpeg] / libavcodec / flac_parser.c
index 7337c027b62662f8b116050b253d1ffc039bcef6..87f3f9504208cb24767e3a4e4b6cbb5ab4f46068 100644 (file)
@@ -2,20 +2,20 @@
  * FLAC parser
  * Copyright (c) 2010 Michael Chinen
  *
- * This file is part of FFmpeg.
+ * This file is part of Libav.
  *
- * FFmpeg is free software; you can redistribute it and/or
+ * Libav is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
- * FFmpeg is distributed in the hope that it will be useful,
+ * Libav is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
+ * License along with Libav; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
@@ -563,7 +563,7 @@ static int flac_parse(AVCodecParserContext *s, AVCodecContext *avctx,
         if (av_fifo_realloc2(fpc->fifo_buf,
                              (read_end - read_start) + av_fifo_size(fpc->fifo_buf)) < 0) {
             av_log(avctx, AV_LOG_ERROR,
-                   "couldn't reallocate buffer of size %d\n",
+                   "couldn't reallocate buffer of size %td\n",
                    (read_end - read_start) + av_fifo_size(fpc->fifo_buf));
             goto handle_error;
         }
@@ -673,10 +673,10 @@ static void flac_parse_close(AVCodecParserContext *c)
     av_free(fpc->wrap_buf);
 }
 
-AVCodecParser flac_parser = {
-    { CODEC_ID_FLAC },
-    sizeof(FLACParseContext),
-    flac_parse_init,
-    flac_parse,
-    flac_parse_close,
+AVCodecParser ff_flac_parser = {
+    .codec_ids      = { CODEC_ID_FLAC },
+    .priv_data_size = sizeof(FLACParseContext),
+    .parser_init    = flac_parse_init,
+    .parser_parse   = flac_parse,
+    .parser_close   = flac_parse_close,
 };