summaryrefslogtreecommitdiff
path: root/codec.c
diff options
context:
space:
mode:
Diffstat (limited to 'codec.c')
-rw-r--r--codec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/codec.c b/codec.c
index fcd3bc3..9f4c976 100644
--- a/codec.c
+++ b/codec.c
@@ -561,13 +561,13 @@ void CodecVideoDecode(VideoDecoder * decoder, const AVPacket * avpkt)
video_ctx->frame_number, used);
}
if (used != pkt->size) {
- if (used >= 0) {
+ if (used >= 0 && used < pkt->size) {
// some tv channels, produce this
Debug(4,
"codec: ooops didn't use complete video packet used %d of %d\n",
used, pkt->size);
- pkt->data += used;
pkt->size -= used;
+ pkt->data += used;
goto next_part;
}
Debug(3, "codec: bad frame %d\n", used);