mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-02-19 21:36:54 +00:00
Merge commit 'fd9badd3cb3b60f5c54dcea35523e1ecca2f67a6'
* commit 'fd9badd3cb3b60f5c54dcea35523e1ecca2f67a6': xwma: Do not leak on failure path Conflicts: libavformat/xwma.c See: 375a0c03a9a401a328a94b3d9f5338ab1524f7ef Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
commit
15ed7ca437
@ -44,7 +44,7 @@ static int xwma_probe(AVProbeData *p)
|
|||||||
static int xwma_read_header(AVFormatContext *s)
|
static int xwma_read_header(AVFormatContext *s)
|
||||||
{
|
{
|
||||||
int64_t size;
|
int64_t size;
|
||||||
int ret;
|
int ret = 0;
|
||||||
uint32_t dpds_table_size = 0;
|
uint32_t dpds_table_size = 0;
|
||||||
uint32_t *dpds_table = NULL;
|
uint32_t *dpds_table = NULL;
|
||||||
unsigned int tag;
|
unsigned int tag;
|
||||||
@ -132,7 +132,7 @@ static int xwma_read_header(AVFormatContext *s)
|
|||||||
for (;;) {
|
for (;;) {
|
||||||
if (pb->eof_reached) {
|
if (pb->eof_reached) {
|
||||||
ret = AVERROR_EOF;
|
ret = AVERROR_EOF;
|
||||||
goto end;
|
goto fail;
|
||||||
}
|
}
|
||||||
/* read next chunk tag */
|
/* read next chunk tag */
|
||||||
tag = avio_rl32(pb);
|
tag = avio_rl32(pb);
|
||||||
@ -155,7 +155,7 @@ static int xwma_read_header(AVFormatContext *s)
|
|||||||
if (dpds_table) {
|
if (dpds_table) {
|
||||||
av_log(s, AV_LOG_ERROR, "two dpds chunks present\n");
|
av_log(s, AV_LOG_ERROR, "two dpds chunks present\n");
|
||||||
ret = AVERROR_INVALIDDATA;
|
ret = AVERROR_INVALIDDATA;
|
||||||
goto end;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Compute the number of entries in the dpds chunk. */
|
/* Compute the number of entries in the dpds chunk. */
|
||||||
@ -189,7 +189,7 @@ static int xwma_read_header(AVFormatContext *s)
|
|||||||
/* Determine overall data length */
|
/* Determine overall data length */
|
||||||
if (size < 0) {
|
if (size < 0) {
|
||||||
ret = AVERROR_INVALIDDATA;
|
ret = AVERROR_INVALIDDATA;
|
||||||
goto end;
|
goto fail;
|
||||||
}
|
}
|
||||||
if (!size) {
|
if (!size) {
|
||||||
xwma->data_end = INT64_MAX;
|
xwma->data_end = INT64_MAX;
|
||||||
@ -210,7 +210,7 @@ static int xwma_read_header(AVFormatContext *s)
|
|||||||
"Invalid bits_per_coded_sample %d for %d channels\n",
|
"Invalid bits_per_coded_sample %d for %d channels\n",
|
||||||
st->codec->bits_per_coded_sample, st->codec->channels);
|
st->codec->bits_per_coded_sample, st->codec->channels);
|
||||||
ret = AVERROR_INVALIDDATA;
|
ret = AVERROR_INVALIDDATA;
|
||||||
goto end;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
st->duration = total_decoded_bytes / bytes_per_sample;
|
st->duration = total_decoded_bytes / bytes_per_sample;
|
||||||
@ -245,7 +245,7 @@ static int xwma_read_header(AVFormatContext *s)
|
|||||||
st->duration = (size<<3) * st->codec->sample_rate / st->codec->bit_rate;
|
st->duration = (size<<3) * st->codec->sample_rate / st->codec->bit_rate;
|
||||||
}
|
}
|
||||||
|
|
||||||
end:
|
fail:
|
||||||
av_free(dpds_table);
|
av_free(dpds_table);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
Loading…
Reference in New Issue
Block a user