summaryrefslogtreecommitdiff
path: root/libavcodec/bmv.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-01-06 23:59:35 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-01-06 23:59:35 +0100
commit7b018e5c8d182b0272477322377b8daafa1c970f (patch)
tree8f526f00d6352279d84ff8c7bcfbb2f78f702bd1 /libavcodec/bmv.c
parent61904467458b16cf89530e2d0875f3786001dc11 (diff)
parent84f2847de394ac447f53306bd4dd73e1af6ea5e4 (diff)
Merge commit '84f2847de394ac447f53306bd4dd73e1af6ea5e4'
* commit '84f2847de394ac447f53306bd4dd73e1af6ea5e4': xl: return a meaningful error code. xan: return a meaningful error code. xxan: return meaningful error codes. zmbv: return more meaningful error codes. yop: use a meaningful error code. c93: return meaningful error codes. bmv: return meaningful error codes. bmp: return meaningful error codes. bink: operate with pointers to AVFrames instead of whole structs. bink: return meaningful error codes. bfi: return meaningful error codes. bethsoftvideo: return meaningful error codes. Conflicts: libavcodec/c93.c libavcodec/xl.c libavcodec/xxan.c libavcodec/yop.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/bmv.c')
-rw-r--r--libavcodec/bmv.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/libavcodec/bmv.c b/libavcodec/bmv.c
index defa1ab88b..715e6a3b62 100644
--- a/libavcodec/bmv.c
+++ b/libavcodec/bmv.c
@@ -68,7 +68,7 @@ static int decode_bmv_frame(const uint8_t *source, int src_len, uint8_t *frame,
int i;
if (src_len <= 0)
- return -1;
+ return AVERROR_INVALIDDATA;
if (forward) {
src = source;
@@ -92,7 +92,7 @@ static int decode_bmv_frame(const uint8_t *source, int src_len, uint8_t *frame,
*/
if (!mode || (tmplen == 4)) {
if (src < source || src >= source_end)
- return -1;
+ return AVERROR_INVALIDDATA;
val = *src;
read_two_nibbles = 1;
} else {
@@ -105,7 +105,7 @@ static int decode_bmv_frame(const uint8_t *source, int src_len, uint8_t *frame,
return -1;
if (!read_two_nibbles) {
if (src < source || src >= source_end)
- return -1;
+ return AVERROR_INVALIDDATA;
shift += 2;
val |= *src << shift;
if (*src & 0xC)
@@ -141,7 +141,7 @@ static int decode_bmv_frame(const uint8_t *source, int src_len, uint8_t *frame,
if (mode >= 4)
mode -= 3;
if (FFABS(dst_end - dst) < len)
- return -1;
+ return AVERROR_INVALIDDATA;
switch (mode) {
case 1:
if (forward) {
@@ -149,7 +149,7 @@ static int decode_bmv_frame(const uint8_t *source, int src_len, uint8_t *frame,
dst - frame + SCREEN_WIDE + frame_off < 0 ||
frame_end - dst < frame_off + len ||
frame_end - dst < len)
- return -1;
+ return AVERROR_INVALIDDATA;
for (i = 0; i < len; i++)
dst[i] = dst[frame_off + i];
dst += len;
@@ -159,7 +159,7 @@ static int decode_bmv_frame(const uint8_t *source, int src_len, uint8_t *frame,
dst - frame + SCREEN_WIDE + frame_off < 0 ||
frame_end - dst < frame_off + len ||
frame_end - dst < len)
- return -1;
+ return AVERROR_INVALIDDATA;
for (i = len - 1; i >= 0; i--)
dst[i] = dst[frame_off + i];
}
@@ -167,13 +167,13 @@ static int decode_bmv_frame(const uint8_t *source, int src_len, uint8_t *frame,
case 2:
if (forward) {
if (source + src_len - src < len)
- return -1;
+ return AVERROR_INVALIDDATA;
memcpy(dst, src, len);
dst += len;
src += len;
} else {
if (src - source < len)
- return -1;
+ return AVERROR_INVALIDDATA;
dst -= len;
src -= len;
memcpy(dst, src, len);