]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/vp8_parser.c
dvbsubdec: check memory allocations and propagate errors
[ffmpeg] / libavcodec / vp8_parser.c
index fbdd0ee5ac72c49fffa84703d57ec96b56add379..8f6459ccec2d798a557a458b7a551ec3bc381629 100644 (file)
 #include "parser.h"
 
 static int parse(AVCodecParserContext *s,
-                           AVCodecContext *avctx,
-                           const uint8_t **poutbuf, int *poutbuf_size,
-                           const uint8_t *buf, int buf_size)
+                 AVCodecContext *avctx,
+                 const uint8_t **poutbuf, int *poutbuf_size,
+                 const uint8_t *buf, int buf_size)
 {
-    s->pict_type= (buf[0]&0x01) ? AV_PICTURE_TYPE_P : AV_PICTURE_TYPE_I;
+    s->pict_type = (buf[0] & 0x01) ? AV_PICTURE_TYPE_P
+                                   : AV_PICTURE_TYPE_I;
 
-    *poutbuf = buf;
+    *poutbuf      = buf;
     *poutbuf_size = buf_size;
     return buf_size;
 }
 
 AVCodecParser ff_vp8_parser = {
-    { CODEC_ID_VP8 },
-    0,
-    NULL,
-    parse,
+    .codec_ids    = { AV_CODEC_ID_VP8 },
+    .parser_parse = parse,
 };