summaryrefslogtreecommitdiff
path: root/libavcodec/vp5.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-12-15 13:41:06 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-12-15 13:41:06 +0100
commitf186ecc164e8dad145d4637ac1d55b66e460af7a (patch)
treeb14e6d2d85dd3589c4a4cc5bb5c730976d9df854 /libavcodec/vp5.c
parent75b7e543df05e9d4dfb1f73a28bceecd0bd1971b (diff)
parentbb675d3ac6d722d5e117ae9042a996b55ca05b1d (diff)
downloadffmpeg-f186ecc164e8dad145d4637ac1d55b66e460af7a.tar.gz
Merge commit 'bb675d3ac6d722d5e117ae9042a996b55ca05b1d'
* commit 'bb675d3ac6d722d5e117ae9042a996b55ca05b1d': vp56: make parse_header return standard error codes Conflicts: libavcodec/vp56.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/vp5.c')
-rw-r--r--libavcodec/vp5.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/libavcodec/vp5.c b/libavcodec/vp5.c
index 3ae7c25f51..46c7fd85f2 100644
--- a/libavcodec/vp5.c
+++ b/libavcodec/vp5.c
@@ -48,18 +48,18 @@ static int vp5_parse_header(VP56Context *s, const uint8_t *buf, int buf_size)
{
vp56_rac_gets(c, 8);
if(vp56_rac_gets(c, 5) > 5)
- return 0;
+ return AVERROR_INVALIDDATA;
vp56_rac_gets(c, 2);
if (vp56_rac_get(c)) {
av_log(s->avctx, AV_LOG_ERROR, "interlacing not supported\n");
- return 0;
+ return AVERROR_PATCHWELCOME;
}
rows = vp56_rac_gets(c, 8); /* number of stored macroblock rows */
cols = vp56_rac_gets(c, 8); /* number of stored macroblock cols */
if (!rows || !cols) {
av_log(s->avctx, AV_LOG_ERROR, "Invalid size %dx%d\n",
cols << 4, rows << 4);
- return 0;
+ return AVERROR_INVALIDDATA;
}
vp56_rac_gets(c, 8); /* number of displayed macroblock rows */
vp56_rac_gets(c, 8); /* number of displayed macroblock cols */
@@ -68,11 +68,11 @@ static int vp5_parse_header(VP56Context *s, const uint8_t *buf, int buf_size)
16*cols != s->avctx->coded_width ||
16*rows != s->avctx->coded_height) {
avcodec_set_dimensions(s->avctx, 16*cols, 16*rows);
- return 2;
+ return VP56_SIZE_CHANGE;
}
} else if (!s->macroblocks)
- return 0;
- return 1;
+ return AVERROR_INVALIDDATA;
+ return 0;
}
static void vp5_parse_vector_adjustment(VP56Context *s, VP56mv *vect)