Unified · Split
| @@ -62,11 +62,15 @@ static av_cold int encode_init(AVCodecContext *avctx) · 61 unmodified lines | ||
| 62 | 62 | flags2 = 1; |
| 63 | 63 | if (avctx->codec->id == AV_CODEC_ID_WMAV1) { |
| 64 | 64 | extradata = av_malloc(4); |
| 65 | + if (!extradata) | |
| 66 | + return AVERROR(ENOMEM); | |
| 65 | 67 | avctx->extradata_size = 4; |
| 66 | 68 | AV_WL16(extradata, flags1); |
| 67 | 69 | AV_WL16(extradata + 2, flags2); |
| 68 | 70 | } else if (avctx->codec->id == AV_CODEC_ID_WMAV2) { |
| 69 | 71 | extradata = av_mallocz(10); |
| 72 | + if (!extradata) | |
| 73 | + return AVERROR(ENOMEM); | |
| 70 | 74 | avctx->extradata_size = 10; |
| 71 | 75 | AV_WL32(extradata, flags1); |
| 72 | 76 | AV_WL16(extradata + 4, flags2); |