Commit 84bf64d3 authored by Vittorio Giovara's avatar Vittorio Giovara

bethsoftvid: simplify return handling

Fixes a double free in case of av_packet_new_side_data() failure.
parent e9ba3098
...@@ -177,7 +177,6 @@ static int read_frame(BVID_DemuxContext *vid, AVIOContext *pb, AVPacket *pkt, ...@@ -177,7 +177,6 @@ static int read_frame(BVID_DemuxContext *vid, AVIOContext *pb, AVPacket *pkt,
if ((ret = av_new_packet(pkt, vidbuf_nbytes)) < 0) if ((ret = av_new_packet(pkt, vidbuf_nbytes)) < 0)
goto fail; goto fail;
memcpy(pkt->data, vidbuf_start, vidbuf_nbytes); memcpy(pkt->data, vidbuf_start, vidbuf_nbytes);
av_free(vidbuf_start);
pkt->pos = position; pkt->pos = position;
pkt->stream_index = vid->video_index; pkt->stream_index = vid->video_index;
...@@ -198,7 +197,6 @@ static int read_frame(BVID_DemuxContext *vid, AVIOContext *pb, AVPacket *pkt, ...@@ -198,7 +197,6 @@ static int read_frame(BVID_DemuxContext *vid, AVIOContext *pb, AVPacket *pkt,
} }
vid->nframes--; // used to check if all the frames were read vid->nframes--; // used to check if all the frames were read
return 0;
fail: fail:
av_free(vidbuf_start); av_free(vidbuf_start);
return ret; return ret;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment