summaryrefslogtreecommitdiff
path: root/libavformat/swfdec.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavformat/swfdec.c')
-rw-r--r--libavformat/swfdec.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavformat/swfdec.c b/libavformat/swfdec.c
index e6ceec818a..c77e28f0c9 100644
--- a/libavformat/swfdec.c
+++ b/libavformat/swfdec.c
@@ -446,7 +446,10 @@ bitmap_end_skip:
goto skip;
if ((res = av_new_packet(pkt, len)) < 0)
return res;
- avio_read(pb, pkt->data, 4);
+ if (avio_read(pb, pkt->data, 4) != 4) {
+ av_free_packet(pkt);
+ return AVERROR_INVALIDDATA;
+ }
if (AV_RB32(pkt->data) == 0xffd8ffd9 ||
AV_RB32(pkt->data) == 0xffd9ffd8) {
/* old SWF files containing SOI/EOI as data start */