Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-09-03 15:36:22 +0400
committerMichael Niedermayer <michaelni@gmx.at>2013-09-03 15:45:03 +0400
commit164b67ca281fa5a47b965a858c7783aa547091b8 (patch)
treeab389c912603ec6def22c96f579b243e0243bc1b /libavcodec/vcr1.c
parent8ba683e629bd44f5c222ff8fe9cfdc101177dc0f (diff)
avcodec/vcr1: replace redundant checks from libav (8aba7968dd604aae91ee42cbce0be3dad7dceb30) by asserts
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/vcr1.c')
-rw-r--r--libavcodec/vcr1.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/libavcodec/vcr1.c b/libavcodec/vcr1.c
index a5ea82d1d6..675ada87e4 100644
--- a/libavcodec/vcr1.c
+++ b/libavcodec/vcr1.c
@@ -26,6 +26,7 @@
#include "avcodec.h"
#include "internal.h"
+#include "libavutil/avassert.h"
#include "libavutil/internal.h"
typedef struct VCR1Context {
@@ -65,9 +66,6 @@ static int vcr1_decode_frame(AVCodecContext *avctx, void *data,
p->pict_type = AV_PICTURE_TYPE_I;
p->key_frame = 1;
- if (buf_size < 32)
- goto packet_small;
-
for (i = 0; i < 16; i++) {
a->delta[i] = *bytestream++;
bytestream++;
@@ -82,8 +80,7 @@ static int vcr1_decode_frame(AVCodecContext *avctx, void *data,
uint8_t *cb = &p->data[1][(y >> 2) * p->linesize[1]];
uint8_t *cr = &p->data[2][(y >> 2) * p->linesize[2]];
- if (buf_size < 4 + avctx->width)
- goto packet_small;
+ av_assert0 (buf_size >= 4 + avctx->width);
for (i = 0; i < 4; i++)
a->offset[i] = *bytestream++;
@@ -104,8 +101,7 @@ static int vcr1_decode_frame(AVCodecContext *avctx, void *data,
buf_size -= 4;
}
} else {
- if (buf_size < avctx->width / 2)
- goto packet_small;
+ av_assert0 (buf_size >= avctx->width / 2);
offset = a->offset[y & 3] - a->delta[bytestream[2] & 0xF];
@@ -128,9 +124,6 @@ static int vcr1_decode_frame(AVCodecContext *avctx, void *data,
*got_frame = 1;
return buf_size;
-packet_small:
- av_log(avctx, AV_LOG_ERROR, "Input packet too small.\n");
- return AVERROR_INVALIDDATA;
}
AVCodec ff_vcr1_decoder = {